let api = 'http://rpc-serveruat:8121/api/'
if(process.env.ServerApp === 'prod'){
  api = 'http://rpc-serverprod:8137/api/'
}
import axios from 'axios'

export class WsStartGateway {


  postUpdateNotice(wx_user: string, data?: any){
    if(!wx_user) return
    axios.post(api + 'updateNotice', {wx_user: wx_user})
  }

  postUpdatePlatformInfo(wx_user: string, data?: any){
    if(!wx_user) return
    axios.post(api + 'updatePlatformInfo', {wx_user: wx_user})
  }

  /**
   * 更新我的数据
   * @param wx_user 
   */
  postUpdateMyData(wx_user: string, video_id: any){
    if(!wx_user || !video_id) return
    axios.post(api + 'updateMyData', {wx_user, video_id: video_id})
  }

  postUpdateProfitRefund(wx_user: any, video_id: any){
    if(!wx_user || !video_id) return
    axios.post(api + 'updateProfitRefund', {wx_user, video_id: video_id})
  }


  /**
   * 通知用户更新
   * @param video_id 
   */
  postUpdateVideo(video_id: number){
    if(!video_id) return
    axios.post(api + 'updateVideo', {video_id})

  }


  /**
   * 更新关注红点
   * @param wx_user 
   * @param data 
   * @returns 
   */
  postUpdateConcern(wx_user: string){
    axios.post(api + 'updateConcern', {wx_user: wx_user})
  }

}
